abstract class Express{
    protected double weight;
    public Express(){}
    public Express(double weight){
        this.weight = weight;
    }
    abstract public double calPrice();
    abstract public void show();
}
abstract public void show();
}
class ZTExpress extends Express {
    private int firstPrice;
    private int secondPrice;

    public ZTExpress() {
    }

    public ZTExpress(double weight, int firstPrice, int secondPrice) {
        super(weight);
        this.firstPrice = firstPrice;
        this.secondPrice = secondPrice;
    }
    public double calPrice(){
        if (weight < 1)
            return weight * firstPrice;
        else
            return firstPrice + (weight-1) * secondPrice;
    }
    public void show(){
        System.out.println("邮寄"+weight+"物品共花费" 	                                  +calPrice()+"元.");
    }


}

    public double calPrice(){
        if (weight < 1)
            return weight * firstPrice;
        else
            return firstPrice + (weight-1) * secondPrice;
    }
    public void show(){
        System.out.println("邮寄"+weight+"物品共花费" 	                                  +calPrice()+"元.");
    }
}

public class Test {
}
